package com.bdxk.android.imdemo.adapter;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.bdxk.android.imdemo.R;
import com.bdxk.android.imdemo.message.MyMessage;

import io.rong.imkit.RongContext;
import io.rong.imkit.model.ProviderTag;
import io.rong.imkit.model.UIConversation;
import io.rong.imkit.model.UIMessage;
import io.rong.imkit.widget.adapter.ConversationListAdapter;
import io.rong.imkit.widget.adapter.MessageListAdapter;
import io.rong.imlib.model.Conversation;

/**
 * Created by weiqinxiao on 15/11/5.
 */
public class ConversationItemListAdapterEx extends MessageListAdapter {
    public ConversationItemListAdapterEx(Context context) {
        super(context);
    }

    @Override
    protected View newView(Context context, int position, ViewGroup group) {
        return super.newView(context, position, group);
    }

    @Override
    protected void bindView(View v, int position, UIMessage data) {
        ProviderTag tag = RongContext.getInstance().getMessageProviderTag(data.getContent().getClass());
        super.bindView(v, position, data);
        if (!tag.showPortrait()){
            TextView textView = (TextView)this.findViewById(v, io.rong.imkit.R.id.rc_time);
            textView.setVisibility(View.GONE);
        }
    }
}
